package com.heima.user.contrller;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.mapper.ApUserMapper;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jay
 * @date 2022/11/17 08:59:11
 */
@RestController
@RequestMapping("/api/v1/login/")
public class ApUserInfoController {

    @Autowired
    private ApUserService apUserService;

    @RequestMapping("/info")
    public ResponseResult getUerInfoById(@RequestBody Integer userId){
        return apUserService.info(userId);
    }

    /**
     * 获取用户信息
     *
     * @param id
     * @return
     */
    @PostMapping("/getUser")
    public ResponseResult getUser(Integer id) {
        return apUserService.getUser(id);
    }
}
